package util;

import common.HandlerBase;
import common.KeyCodes;

/**
 * 按键模拟
 * @author cccssw
 * 
 */
public class KeyPressSimulation {



    public static void KeyDown(int keyCode) {
        HandlerBase.getRobot().keyPress(keyCode);
    }

    public static void KeyUp(int keyCode) {
        HandlerBase.getRobot().keyRelease(keyCode);
    }

    public static void pressKey(int keyCode) {
        HandlerBase.getRobot().keyPress(keyCode);
        HandlerBase.getRobot().keyRelease(keyCode);
    }

    public static void pressKey(int keyCode1, int keyCode2) {
        HandlerBase.getRobot().keyPress(keyCode1);
        HandlerBase.getRobot().keyPress(keyCode2);
        HandlerBase.getRobot().keyRelease(keyCode2);
        HandlerBase.getRobot().keyRelease(keyCode1);
    }

    public static void pressKey(int keyCode1, int keyCode2, int keyCode3) {
        HandlerBase.getRobot().keyPress(keyCode1);
        HandlerBase.getRobot().keyPress(keyCode2);
        HandlerBase.getRobot().keyPress(keyCode3);
        HandlerBase.getRobot().keyRelease(keyCode3);
        HandlerBase.getRobot().keyRelease(keyCode2);
        HandlerBase.getRobot().keyRelease(keyCode1);
    }
}
